python split string in pairs

53

python split word into letter pairs -

string = 'ABCDXY'
[string[i:i+2] for i in xrange(0, len(string), 2)]

Comments

Submit
0 Comments